package com.oe.market.modules.cq.model.mapper;

import com.oe.market.modules.cq.model.bean.CQMessage;
import com.oe.market.modules.cq.model.dto.CQPostMessageDto;

import java.math.BigInteger;

public class CQMessageMapper {
    protected CQMessage cqMessage = new CQMessage();

    public CQMessageMapper(CQMessage cqMessage){
        this.cqMessage = cqMessage;
    }
    public CQMessageMapper(CQPostMessageDto postMessageDto, BigInteger fromAccount) {
//        cqMessage.messageId = postMessageDto.messageId;
        cqMessage.senderId = postMessageDto.userId;
        cqMessage.senderSex = postMessageDto.sender.sex;
        cqMessage.message = postMessageDto.message;
        cqMessage.rawMessage = postMessageDto.rawMessage;
        cqMessage.messageType = postMessageDto.messageType;
        cqMessage.subType = postMessageDto.subType;
        cqMessage.postType = postMessageDto.postType;
        cqMessage.reply = postMessageDto.reply;
        cqMessage.groupId = postMessageDto.groupId;
        cqMessage.fromAccountId = fromAccount;
    }

    public CQMessage getCqMessage() {
        return cqMessage;
    }
}
